import subprocess
from multiprocessing import Pool


def work(process_id):
    subprocess.run(
        ['python', '-m', 'src.data.data_generate', '--headless', '1', '--num_data', '41', '--start_index', f"{process_id * 41}"]
    )

if __name__ == "__main__":
    num_processes = 12
    with Pool(processes=num_processes) as pool:
        pool.map(work, range(num_processes))

